package cn.zust.ly.EyExample.Ez49;

import java.util.Scanner;

/**
 * Created by liy on 2016/11/25.
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m=0,x=0;
        for (int i = 0; i < n; i++) {
            int a = sc.nextInt();
            if (a > m) {
                m=a;x=i;
            }
        }
        System.out.println(m+" "+x);

    }
}
